home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
shareware
/
intuition
/
yak_1.57
/
source
/
clickdrive.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-17
|
991b
|
52 lines
#include <exec/types.h>
#include <devices/trackdisk.h>
#include <proto/exec.h>
#include "yak.h"
/*
* Set drive click off if toggle is TRUE
* Set drive click on otherwise
*
*/
void __regargs
SetClickDrive (UBYTE toggle)
{
struct IOExtTD *td;
struct MsgPort *po;
struct TDU_PublicUnit *tpu;
long unit;
if (po = CreatePort (NULL, 0))
{
for (unit = 0; unit < 4; unit++)
{
if (td = (struct IOExtTD *) CreateExtIO (po, sizeof (struct IOExtTD)))
{
if (!(OpenDevice ("trackdisk.device", unit, (struct IORequest *) td, 0L)))
{
tpu = (struct TDU_PublicUnit *) td->iotd_Req.io_Unit;
if (toggle==TRUE)
{
/* Stop clicking ! */
tpu->tdu_PubFlags |= TDPF_NOCLICK;
}
else
{
/* Keep on clicking ! */
tpu->tdu_PubFlags &= ~TDPF_NOCLICK;
}
CloseDevice ((struct IORequest *) td);
DeleteExtIO ((struct IORequest *) td);
}
}
}
DeletePort (po);
}
}